<script lang="ts" setup>
const tableData = [
  {
    title: '新闻文章',
    category: '娱乐',
    time: '2024.4.17',
    state: '已发布'
  },
  {
    title: '新闻文章',
    category: '娱乐',
    time: '2024.4.17',
    state: '已发布'
  },  {
    title: '新闻文章',
    category: '娱乐',
    time: '2024.4.17',
    state: '已发布'
  },  {
    title: '新闻文章',
    category: '娱乐',
    time: '2024.4.17',
    state: '已发布'
  },  {
    title: '新闻文章',
    category: '娱乐',
    time: '2024.4.17',
    state: '已发布'
  },
  
]
import {
  Delete,
  Edit,
  Search,

} from '@element-plus/icons-vue'
import { ref } from 'vue'
const currentPage4 = ref(4)
const pageSize4 = ref(10)
const small = ref(false)
const background = ref(false)
const disabled = ref(false)
const total=ref(100)

const handleSizeChange = (val: number) => {
  console.log(`${val} items per page`)
}
const handleCurrentChange = (val: number) => {
  console.log(`current page: ${val}`)
}
import { reactive } from 'vue'

const formInline = reactive({
  user: '',
  region: '',
  date: '',
})

const onSubmit = () => {
  console.log('submit!')
}
</script>

<template>
      <el-card >
   <div class="card-header">
        <span>文章管理</span>
    <el-button type="success">上传</el-button>
      </div>
      <el-form :inline="true" :model="formInline" class="demo-form-inline">
    <el-form-item label="文章标题">
      <el-input v-model="formInline.user" placeholder="请输入..." clearable />
    </el-form-item>
    <el-form-item label="状态">
      <el-select
        v-model="formInline.region"
        placeholder="请选择"
        clearable
      >
        <el-option label="已发布" value="已发布" />
        <el-option label="未发布" value="未发布" />
      </el-select>
    </el-form-item>
   
    <el-form-item>
      <el-button type="primary" @click="onSubmit">搜索</el-button>
    </el-form-item>
    <el-form-item>
      <el-button type="default" @click="onSubmit">重置</el-button>
    </el-form-item>
  </el-form>
    <el-table :data="tableData" border style="width: 100%">
      <el-table-column prop="title" label="文章标题"  />
      <el-table-column prop="category" label="分类"  />
      <el-table-column prop="time" label="发表时间" />
      <el-table-column prop="state" label="状态" />
      <el-table-column  label="操作" width="180" >
        <div>
<el-button type="primary" :icon="Edit" circle />
<el-button type="danger" :icon="Delete" circle />
</div>
     </el-table-column>>
    </el-table>
    <el-pagination
      class="el-p"
      v-model:current-page="currentPage4"
      v-model:page-size="pageSize4"
      :page-sizes="[10, 20, 30, 40]"
      :small="small"
      :disabled="disabled"
      :background="background"
      layout=" jumper,total, sizes, prev, pager, next"
      :total="total"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
    />
 
  </el-card>
  
  </template>
  
<style scoped>
  .el-p{
    margin-top: 20xp;
    display: flex;
    justify-content: flex-end;


  }
  .demo-form-inline .el-input {
  --el-input-width: 220px;
}

.demo-form-inline .el-select {
  --el-select-width: 220px;
}

.card-header{
    display:flex;
    justify-content: space-between;
}
</style>
  